
grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination

grails.mime.disable.accept.header.userAgents = ['Gecko', 'WebKit', 'Presto', 'Trident']
grails.mime.types = [ // the first one is the default format
                      all:           '*/*', // 'all' maps to '*' or the first available format in withFormat
                      atom:          'application/atom+xml',
                      css:           'text/css',
                      csv:           'text/csv',
                      form:          'application/x-www-form-urlencoded',
                      html:          ['text/html','application/xhtml+xml'],
                      js:            'text/javascript',
                      json:          ['application/json', 'text/json'],
                      multipartForm: 'multipart/form-data',
                      rss:           'application/rss+xml',
                      text:          'text/plain',
                      hal:           ['application/hal+json','application/hal+xml'],
                      xml:           ['text/xml', 'application/xml']
]

grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']

// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"

grails.views.gsp.sitemesh.preprocess = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'

// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []
// whether to disable processing of multi part requests
grails.web.disable.multipart=false

// request parameters to mask when logging exceptions
grails.exceptionresolver.params.exclude = ['password']
grails.mime.disable.accept.header.userAgents = []
// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
grails.hibernate.cache.queries = false

activiti {
    processEngineName = "activiti-engine-default"
    jobExecutorActivate = false
    mailServerHost = "smtp.yourserver.com"
    mailServerPort = "25"
    mailServerUsername = ""
    mailServerPassword = ""
    mailServerDefaultFrom = "username@yourserver.com"
    history = "audit" // "none", "activity", "audit" or "full"
    sessionUsernameKey = "username"
    useFormKey = true
}
environments {
    development {
        grails.logging.jul.usebridge = true
        grails.config.locations = ["classpath:datasource_dev.properties"]
        activiti {
            processEngineName = "activiti-engine-dev"
            databaseSchemaUpdate = true // true, false or "create-drop"
        }
    }
    production {
        grails.logging.jul.usebridge = false
        grails.config.locations = ["classpath:datasource_pro.properties"]
        // TODO: grails.zxserverURL  = "http://www.changeme.com"
        activiti {
            processEngineName = "activiti-engine-prod"
            databaseSchemaUpdate = false
            jobExecutorActivate = true    //需要 执行 insert into act_ge_property values('historyLevel',2,1)  ;update ACT_GE_PROPERTY set  VALUE_=5.8 ,REV_=2 WHERE  NAME_='schema.version'
        }
    }
}
grails.views.gsp.encoding="UTF-8"

// log4j configuration
log4j.main = {
    appenders {
//           console name:'stdout', encoding: 'UTF8', layout:pattern(conversionPattern: '%c{2} %m%n')
        rollingFile name: 'file',
                maxFileSize: 1024 * 1024*100,
//   	layout:pattern(conversionPattern: '%d{ABSOLUTE} %5p %c{1}:%L - %m%n'),
                file: "../temp/sharing.log"
        //file: System.getProperty("java.io.tmpdir") + "/prm.log"
    }
    root {
        error 'stdout', 'file'
    }
    error 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
            'org.hibernate',
            'net.sf.ehcache.hibernate'
    warn 'org.mortbay.log'
    info 'grails.app.controller', 'grails.app.service', 'grails.app'
    debug 'grails.app.controller',
            'grails.app.service',
            'grails.app',
            'org.hibernate.tool.hbm2ddl'
}
grails.plugin.springsecurity.active = true// 		是否启用该插件。
grails.plugin.springsecurity.debug.useFilter = true// 	Whether to use the DebugFilter to log request debug information to the console
grails.plugin.springsecurity.password.algorithm = 'SHA-256'
grails.plugin.springsecurity.apf.postOnly = false

grails.plugin.springsecurity.successHandler.alwaysUseDefault = false//如果true，总是将重定向到successHandler. defaultTargetUrl的值后成功的身份验证;否则将重定向到最初请求的页面。
grails.plugin.springsecurity.successHandler.defaultTargetUrl = '/admin/major.gsp'//Default post-login URL if there is no saved request that triggered the login.
grails.plugin.springsecurity.successHandler.useReferer = true// 是否使用 HTTP Referer报头来确定登录后的目的地。
grails.plugin.springsecurity.successHandler.ajaxSuccessUrl = '/login/ajaxSuccess'// 是否使用 HTTP Referer报头来确定登录后的目的地。

grails.plugin.springsecurity.dao.hideUserNotFoundExceptions = true// 	if true, throws a new BadCredentialsException if a username is not found or the password is incorrect, but if false re-throws the UsernameNot FoundException thrown by UserDetailsService (considered less secure than throwing BadCredentialsException for both exceptions)
grails.plugin.springsecurity.apf.filterProcessesUrl = '/login_check'       //登录验证的路径,前台把用户名和密码提交到这个路径 ,默认是j_spring_security_check
grails.plugin.springsecurity.apf.usernameParameter = 'username'       //前台提交用户名  时用到的参数名称,可以自定义,与前台一致即可
grails.plugin.springsecurity.apf.passwordParameter = 'password'      //前台提交密码  时用到的参数名称,可以自定义,与前台一致即可
grails.plugin.springsecurity.logout.filterProcessesUrl = '/logout'   //退出验证的路径, 前台要与此一直
grails.plugin.springsecurity.securityConfigType = 'Annotation'// "Annotation", "Requestmap", or "InterceptUrlMap"
grails.plugin.springsecurity.controllerAnnotations.lowercase = true// Whether to do URL comparisons using lowercase.
//grails.plugin.springsecurity.rememberMe.alwaysRemember = true//总是记住登陆

// Added by the Spring Security Core plugins:    //执行 s2-quickstart combudget_yhmd StaffMember Authority 自动生成后
grails.plugin.springsecurity.useSessionFixationPrevention = true//会话固定攻击防范将useSessionFixationPrevention属性设置为true
grails.plugin.springsecurity.userLookup.userDomainClassName = 'system.StaffMember'        //用户实体类,可以指向自定义的用户实体
grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'system.StaffMemberRole'  //用户与权限关联实体类,可以指向自定义的关联实体
grails.plugin.springsecurity.authority.className = 'system.Role'             //权限实体类,可以指向自定义的权限实体
grails.plugin.springsecurity.useSecurityEventListener = true
grails.plugin.springsecurity.cacheUsers = false// 	If true, logins are cached using an EhCache.
grails.plugin.springsecurity.rejectIfNoRule = true  // 如果rejectIfNoRule为true （默认值），则已没有请求映射任何 URL (注释、 controllerAnnotations.staticRules或interceptUrlMap中的条目或一个Requestmap实例) 将被拒绝的所有用户
grails.plugin.springsecurity.fii.rejectPublicInvocations = true//不允许 URL 访问时没有请求映射   如果它是true （默认值） 取消映射 Url 将触发IllegalArgumentException，然后将显示错误页面
grails.plugin.springsecurity.printStatusMessages = true
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
        '/'                          : ['permitAll'],
        '/modeler.html'              : ['permitAll'],
        '/admin/login.gsp'          : ['permitAll'],
        '/j_spring_cas_security_check'               : ['permitAll'],
        '/j_spring_cas_security_check*'               : ['permitAll'],
        '/j_spring_cas_security_check/*'               : ['permitAll'],
        '/login_check'               : ['permitAll'],
        '/login/*'                  : ['permitAll'],
        '/logout/*'                  : ['permitAll'],
        '/logout/'                   : ['permitAll'],

        '/login/*'                   : ['permitAll'],
        '/activit/**'                   : ['permitAll'],
        '/account/**'                   : ['permitAll'],

        '/*/**'                  : ['permitAll'],
        '/icons/**'                  : ['permitAll'],
        '/**/js/**'                  : ['permitAll'],
        '/**/css/**'                 : ['permitAll'],
        '/**/icons/**'                 : ['permitAll'],
        '/**/images/**'              : ['permitAll'],
        '/**/processPicture/**'              : ['permitAll'],
        '/**/*.json'              : ['permitAll']


]
